#require:host\get-ping

#http://support.microsoft.com/kb/968930

param(
	[string]$computername,
	[string]$username,
	[string]$password 
)
try {
	$creds = New-Object System.Management.Automation.PSCredential $username, (ConvertTo-SecureString $password -AsPlainText -force) 
	$result = Invoke-Command -ComputerName $computername -Credential $creds -Authentication CredSSP -scriptBlock {
		"Y"
	}
	if($result -eq "Y") {
		1
	}
} catch {
	Write-Error $_
}
0
